<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div class="sanji_cont">
	<c:if test="${empty userInfo}">
	<div class="sanji_cont_js" style="height:53px; line-height:53px;">
		<form name="form1" method="post" action="/login" id="userLoginForm">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td><a href="/reglogin"><span class="reg15second">15秒注册</span></a></td>
					<td><span class="sanji_regname">邮箱：</span></td>
					<td><input type="text" class="sanjitext" id="userEmail" name="userEmail" maxlength="20"/></td>
					<td><span class="sanji_regname">密码：</span></td>
					<td><input type="password" class="sanjitext" name="passworld" id="passworld" maxlength="16"/></td>
					<td><input type="button" id="login-ajax" value=" " class="sanjireg" /><span id="errortips"></span></td>
				</tr>
			</table>
		</form>
	</div>
	</c:if>
	<div class="zxzx_dlhly">
		<c:if test="${not empty userInfo}">
			<span class="bold14px666">在线咨询：</span>
		</c:if>
		<c:if test="${empty userInfo}">登录后留言</c:if>
	</div>
	<c:if test="${not empty userInfo && not empty catalog && not empty commend_set_id}">
		<div class="table715px">
			<form name="form1" method="post" action="/commend/add/${catalog}/${commend_set_id}" id="userCommendForm">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td><textarea class="sanji_textarea" id="content" name="content" onclick="cleanErrortips();"></textarea></td>
					</tr>
					<tr>
						<td id="commend-errortips">&nbsp;</td>
					</tr>
					<tr>
						<td valign="bottom"><input type="button" id="commend-send-ajax" value=" " class="sanjimessage" /></td>
					</tr>
				</table>
			</form>
		</div>
	</c:if>
	<c:if test="${empty catalog || empty commend_set_id}">
		&nbsp;&nbsp;非法调用模式，catalog or commend_set_id is null!
	</c:if>
</div>
<script type="text/javascript">
<!--
	$("#commend-send-ajax").click(function(){
		if(commendCheck()){
			$('#userCommendForm').ajaxSubmit(function(data) {
				if(eval(data).result=="${tip['TIPS_AJAX_SUCCESS']}"){
					window.location.reload(); 
				}else{
					$("#commend-errortips").text("评论失败！");
				}
			});
			return false;
		}
	});
	function cleanErrortips(){
		$("#commend-errortips").html("&nbsp;");
	}
	function commendCheck(){
		var content = $("#content").val();
		if(content==''){
			$("#commend-errortips").text("评论信息不能为空！");
			return false;
		}
		return true;
	}

	$("#login-ajax").click(function(){
		if(loginCheck()){
			$('#userLoginForm').ajaxSubmit(function(data) {
				if(eval(data).result=="${tip['TIPS_AJAX_SUCCESS']}"){
					window.location.reload(); 
				}else{
					$("#errortips").text("登录失败");
				}
			});
			return false;
		}
	});
	
	function loginCheck(){
		var isTrue = checkEmail($("#userEmail"));
		if(isTrue){
			isTrue = checkPassword($("#passworld"));
		}
		return isTrue;
	}
-->
</script>